/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JRentPanel.java
 *
 * Created on 2009-8-3, 9:37:18
 */

package cn.ekuma.epos.rant;

import cn.ekuma.data.dao.I_DataLogic;
import cn.ekuma.data.ui.swing.SwingEditorRecord;
import cn.ekuma.epos.datalogic.I_DataLogicCustomers;
import cn.ekuma.epos.datalogic.I_DataLogicSales;
import cn.ekuma.epos.panel.JPanelTableDAO;
import com.openbravo.data.basic.BasicException;
import com.openbravo.data.user.DirtyManager;
import com.openbravo.data.user.EditorListener;
import com.openbravo.pos.base.AppLocal;
import com.openbravo.pos.base.AppView;
import com.openbravo.pos.mode.POS_UI_Swing_Model;
import com.openbravo.bean.Rant;
import java.awt.Component;

/**
 *
 * @author Administrator
 */
public class JRentPanel extends JPanelTableDAO<Rant> implements EditorListener {
    private JRentEditor jeditor;
    private JRentFilter jRantFilter;
    

    public JRentPanel() {
    	super();
    }

     @Override
    protected void init() {
       
        jRantFilter = new JRentFilter(mode.getDLSales(),mode.getDLCustomer());
        jeditor=new JRentEditor(this);
    }

    @Override
    public SwingEditorRecord getEditor() {
        return jeditor;
    }

    @Override
    public Component getFilter() {
        return jRantFilter.getComponent();
    }

    @Override
    public void updateValue(Object value) {
    }

    @Override
    public String getTitle() {
        return AppLocal.getIntString("Menu.Rent");
    }

    public void activate() throws BasicException {
        jeditor.activate();
        jRantFilter.activate();
        super.activate();
    }

    public AppView getApp() {
        return (AppView) app;
    }

    public I_DataLogicCustomers getDlCustomers() {
        return mode.getDLCustomer();
    }

    public I_DataLogicSales getM_dlSales() {
        return mode.getDLSales();
    }

    public JRentFilter getjRantFilter() {
        return jRantFilter;
    }

    public DirtyManager getDirty() {
        return dirty;
    }

	@Override
	public I_DataLogic getDataLogic() {
		return mode.getDLSales();
	}

	@Override
	public Class getSuportClass() {
		return Rant.class;
	}

	@Override
	public String getObjectRenderString(Rant obj) {
		return obj.getM_sName();
	}

	public void saveData() throws BasicException {
		bd.saveData();
	}

	@Override
	public String getModelName() {
		return POS_UI_Swing_Model.MODEL_NAME;
	}
}
